module.exports = {
    chainWebpack(config) {
        config.when(process.env.NODE_ENV !== 'development', config => {
            config.optimization.minimizer('terser').tap(options => {
                options[0].terserOptions.compress.drop_console = true
                return options
            })
        })
        config.plugin('html').tap(args => {
            args[0].title = '南通经济技术开发区网安智能防控平台';
            return args;
        })
    },
    css: {
        loaderOptions: {
            less: {
                modifyVars: {
                    "primary-color": "#378EF0",
                },
                javascriptEnabled: true, //允许链式调用的换行
            },
        },
    },
    devServer: {
        // 跨域
        disableHostCheck: true,
        proxy: {
            "/api": {
                target: "http://180.167.78.98:8248",
                changeOrigin: true,
                pathRewrite: {
                    "^/api": "/",
                },
            },
        },
    },
};
